#TODO
#
from config import *
from network import *

#codename python-strike v.0.1.2h

#function for testing the range of configuration values
def init_range(cfg, **kwargs):
	if len(kwargs):
		last_parameter = kwargs.keys()[-1]
		last_parameter_values = kwargs[last_parameter]
		del kwargs[last_parameter]
		for value in last_parameter_values:
			setattr(cfg, last_parameter, value)
			init_range(cfg, ** kwargs)
	else:
		init(cfg)

#main initialization function of the program
def init(cfg = Config()):
	net = Network(cfg)
	#net.draw.clean_folder()
	if cfg.verbose: cfg.log('built', 2)

	if cfg.allow_training:
		net.train()
	if cfg.verbose: cfg.log('trained', 2)

	if cfg.allow_testing:  net.test()
	if cfg.verbose: cfg.log('tested', 2)

	if cfg.verbose: cfg.log('reporting', 2)
	net.report(cfg.verbose)

#initialization of the program
eta = [x / 100.0 for x in xrange(10, 100, 5)]
tau = [x / 1000.0 for x in xrange(1, 15, 1)]
nna_nit = [ x  for x in xrange(10,100,10)]
terminal_weight_max = [x / 10.0 for x in xrange(2, 100)]
training_positive_window = [x / 100.0 for x in xrange(10, 100, 5)]
training_negative_window = [x / 100.0 for x in xrange(10, 100, 5)]
neighborhood_power = [x / 100.0 for x in xrange(5, 100, 5)]
#for x in xrange(3):
init_range(Config())